﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bonobo.Irc.Client
{
    /// <summary>
    /// Factory pozadavku na server
    /// FIXME: drop czech comments
    /// </summary>
    // FIXME: make class internal sealed, make members public
    [Obsolete]
    public class IrcRequestFactory
    {
        // FIXME: is this needed?
        public IrcRequestFactory()
        {

        }

        public IrcRequestFactory(String username)
        {
            Username = username;
        }


        public String Username 
        { 
            get; 
            set;
        }



        internal IrcRequest SendMessage()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest Pong(String daemon)
        {
            return new IrcRequest(IrcProtocol.Requests.Pong, Username, daemon);
        }

        internal IrcRequest Ping(String daemon)
        {
            return new IrcRequest(IrcProtocol.Requests.Ping, Username, daemon);
        }

        internal IrcRequest Quit(String quitMessage)
        {
            if (String.IsNullOrEmpty(quitMessage))
            {
                return new IrcRequest(IrcProtocol.Requests.Quit, Username);
            }
            return new IrcRequest(IrcProtocol.Requests.Quit, Username, quitMessage);
        }


        /// <summary>
        /// Sets connection password. The password must be set before connection is made (before NICK/USER commands). 
        /// 
        /// Posible return codes:
        /// ERR_NEEDMOREPARAMS	
        /// ERR_ALREADYREGISTRED
        /// </summary>
        /// <param name="password"></param>
        /// <returns></returns>
        internal IrcRequest SetConnectionPassword(String password)
        {
            return new IrcRequest(IrcProtocol.Requests.Pass, Username, password);
        }

        internal IrcRequest SetNick(String nickname)
        {
            return new IrcRequest(IrcProtocol.Requests.Nick, Username, nickname);
        }

        internal IrcRequest SetUser(String username, String realname)
        {
            String hostname = "hostname";
            String servername = "servername";
            return new IrcRequest(IrcProtocol.Requests.User, Username, username, hostname, servername, realname);
        }

        internal IrcRequest JoinChannel()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest SetChannelTopic()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest ViewNames()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest ListChannels()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest InviteUser()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest KickUser()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest SendPrivateMessage()
        {
            throw new NotImplementedException();
        }

        internal IrcRequest SendNotice()
        {
            throw new NotImplementedException();
        }
    }
}
